package com.yuju.enums;
/**
 * 
 * 类名：RegisterReturnCodeEnum  <br />
 *
 * 功能：注册相关
 *
 * @author : zhousc <br />
 * @Date : 2018年1月8日 上午10:27:20  <br />
 * @version : 1.1 <br />
 */
public enum RegisterReturnCodeEnum {
	CODE_FAILURE("yuju-register-1000", "验证码已失效"),
	CODE_VAILD_FAILURE("yuju-register-1001", "验证码校检失败"),
	ID_REPEAT("yuju-register-1002", "此账号已注册"),
	REGISTER_SUCCESS("yuju-register-1003", "注册成功"),
	REGISTER_FAILURE("yuju-register-1004", "注册失败"),
	WX_CODE_NOT_NULL("yuju-register-1005", "微信CODE不能为空");
	private String code;
	private String desc;
	
	RegisterReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (RegisterReturnCodeEnum enume : RegisterReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}